// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Vuetify from 'vuetify'
import config from './config'
import MyComponent from './components/MyComponent'
import './http';
import 'vuetify/dist/vuetify.min.css'
import qs from 'qs'
import 'element-ui/lib/theme-chalk/index.css';
import './assets/material.css'
import Distpicker from 'v-distpicker'
import Print from './utils/print'
Vue.use(Print)
// import 'babel-polyfill'

// import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
Vue.use(ElementUI)

// import '@/styles/index.scss' // global css

import cache from '@/utils/cache'
cache.loadingCache()

// import '@/permission' // permission control
// import '@/styles/animate.css'

/** 事件传递 */
// import VueBus from 'vue-bus'
// Vue.use(VueBus)

Vue.use(Vuetify)
// Vue.use(Vuetify, { theme: config.theme})
Vue.use(MyComponent)
Vue.prototype.$qs = qs;

Vue.config.productionTip = false //阻止启动生产消息，常用作指令。


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

/** 常用flex组件 */
import {
  Flexbox,
  FlexboxItem
} from '@/components/flexbox'

Vue.component('flexbox', Flexbox)
Vue.component('flexbox-item', FlexboxItem)
Vue.component('v-distpicker', Distpicker)
/** 懒加载图片 */
import VueLazyload from 'vue-lazyload'
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: require('@/assets/img/send_img.png'),
  loading: require('@/assets/img/loading.gif'),
  attempt: 1
})

import * as filters from './filters' // global filters
// 注册全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})



// 自定义全局点击空白处组件
// import clickoutside from './directives'
// Vue.directive('clickoutside', clickoutside)
// import empty from './directives/empty'
// Vue.use(empty)
// import photo from './directives/photo'
// Vue.use(photo)

// 表情
import {
  emoji
} from './utils/emoji'
Vue.prototype.emoji = emoji

Vue.config.productionTip = false

// 处理时间的过滤器
Vue.use(require('vue-moment'))
import moment from 'moment'
moment.locale('zh_cn')

